package com.maizijinf;

import java.util.concurrent.*;

/**
 * Created by Germmy on 2016/5/14.
 */
public class TestMain {
    public  static  void main(String args[]){

        BlockingQueue<String> myBq=new LinkedBlockingQueue<String>(10);

        //只创建一个生产线程
        ExecutorService es=Executors.newFixedThreadPool(1);
        es.execute(new Producer(myBq));


        //只创建一个消费线程
        ExecutorService es2=Executors.newFixedThreadPool(1);
        es2.execute(new Consumer(myBq));


    }
}
